package com.android.systemui.ios;

import android.os.RemoteException;

public class GuardServiceStub implements IGuardService {

    private final ISystemGuardService mService;

    public GuardServiceStub(ISystemGuardService service) {
        mService = service;
    }

    @Override
    public void setDisturbEnable(boolean enable) {
        if (mService != null) {
            try {
                mService.setDisturbEnable(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public int getBrightnessAutomatic() {
        if (mService != null) {
            try {
                return mService.getBrightnessAutomatic();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public void setBrightnessAutomatic(boolean enable) {
        if (mService != null) {
            try {
                mService.setBrightnessAutomatic(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setBrightnessValue(int value) {
        if (mService != null) {
            try {
                mService.setBrightnessValue(value);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setBrightnessAdj(float value) {
        if (mService != null) {
            try {
                mService.setBrightnessAdj(value);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setAirplaneMode(boolean enable) {
        if (mService != null) {
            try {
                mService.setAirplaneMode(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setDataConnectedEnable(int type) {
        if (mService != null) {
            try {
                mService.setDataConnectedEnable(type);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setGpsEnable(boolean enable) {
        if (mService != null) {
            try {
                mService.setGpsEnable(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public boolean isBluetoothEnabled() {
        if (mService != null) {
            try {
                return mService.isBluetoothEnabled();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    @Override
    public void setBluetoothEnabled(boolean enable) {
        if (mService != null) {
            try {
                mService.setBluetoothEnabled(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public boolean isHotspotEnabled() {
        if (mService != null) {
            try {
                return mService.isHotspotEnabled();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    @Override
    public void setHotspotEnabled(boolean enable) {
        if (mService != null) {
            try {
                mService.setHotspotEnabled(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public boolean isWifiEnabled() {
        if (mService != null) {
            try {
                return mService.isWifiEnabled();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    @Override
    public void setWifiEnabled(boolean enable) {
        if (mService != null) {
            try {
                mService.setWifiEnabled(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public boolean isTorchEnabled() {
        if (mService != null) {
            try {
                return mService.isTorchEnabled();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    @Override
    public void setTorchEnabled(boolean enable) {
        if (mService != null) {
            try {
                mService.setTorchEnabled(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setAudioSilentEnable(boolean enable) {
        if (mService != null) {
            try {
                mService.setAudioSilentEnable(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setAudioVibrateEnable(boolean enable) {
        if (mService != null) {
            try {
                mService.setAudioVibrateEnable(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public int getRingerMode() {
        if (mService != null) {
            try {
                return mService.getRingerMode();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public void setRingerMode(int mode) {
        if (mService != null) {
            try {
                mService.setRingerMode(mode);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setStreamVolume(int stream, int volume) {
        if (mService != null) {
            try {
                mService.setStreamVolume(stream, volume);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public int getStreamVolume(int stream) {
        if (mService != null) {
            try {
                return mService.getStreamVolume(stream);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int getStreamMinVolume(int stream) {
        if (mService != null) {
            try {
                return mService.getStreamMinVolume(stream);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int getStreamMaxVolume(int stream) {
        if (mService != null) {
            try {
                return mService.getStreamMaxVolume(stream);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int getBrightnessMin() {
        if (mService != null) {
            try {
                return mService.getBrightnessMin();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int getBrightnessMax() {
        if (mService != null) {
            try {
                return mService.getBrightnessMax();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int getBrightnessCurrent() {
        if (mService != null) {
            try {
                return mService.getBrightnessCurrent();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public float getBrightnessAdj() {
        if (mService != null) {
            try {
                return mService.getBrightnessAdj();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int getScreenRecord() {
        if (mService != null) {
            try {
                return mService.getScreenRecord();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public void setScreenRecording(boolean start) {
        if (mService != null) {
            try {
                mService.setScreenRecording(start);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public boolean isRotationLocked() {
        if (mService != null) {
            try {
                return mService.isRotationLocked();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    @Override
    public void setRotationLocked(boolean enable) {
        if (mService != null) {
            try {
                mService.setRotationLocked(enable);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void postRefresh() {
        if (mService != null) {
            try {
                mService.postRefresh();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void sysReboot(String reason) {
        if (mService != null) {
            try {
                mService.sysReboot(reason);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void sysShutdown() {
        if (mService != null) {
            try {
                mService.sysShutdown();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void sysRestore(boolean b1, boolean b2) {
        if (mService != null) {
            try {
                mService.sysRestore(b1, b2);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void sysUpgrade(boolean verify, String file) {
        if (mService != null) {
            try {
                mService.sysUpgrade(verify, file);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public String getProperties(String key, String def) {
        if (mService != null) {
            try {
                return mService.getProperties(key, def);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    @Override
    public void setProperties(String key, String value) {
        if (mService != null) {
            try {
                mService.setProperties(key, value);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setGlobalSettings(String key, String value) {
        if (mService != null) {
            try {
                mService.setGlobalSettings(key, value);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setSystemSettings(String key, String value) {
        if (mService != null) {
            try {
                mService.setSystemSettings(key, value);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void sendKeyEvent(int keyCode, int flags) {
        if (mService != null) {
            try {
                mService.sendKeyEvent(keyCode, flags);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setNightMode(int mode) {
        if (mService != null) {
            try {
                mService.setNightMode(mode);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public int getNightMode() {
        if (mService != null) {
            try {
                return mService.getNightMode();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int execShell(String cmd) {
        if (mService != null) {
            try {
                return mService.execShell(cmd);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public void userActivity() {
        if (mService != null) {
            try {
                mService.userActivity();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void setNavVisible(int vis) {
        if (mService != null) {
            try {
                mService.setNavVisible(vis);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public int openCamera() {
        if (mService != null) {
            try {
                return mService.openCamera();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int openEmergencyCall() {
        if (mService != null) {
            try {
                return mService.openEmergencyCall();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public boolean isLocked() {
        if (mService != null) {
            try {
                return mService.isLocked();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    @Override
    public int requestLock(int flag) {
        if (mService != null) {
            try {
                return mService.requestLock(flag);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int requestVerify(String str) {
        if (mService != null) {
            try {
                return mService.requestVerify(str);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public int requestFaceRecognition() {
        if (mService != null) {
            try {
                return mService.requestFaceRecognition();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    @Override
    public void performNotificationEvent(int action, String pkg, String key) {
        if (mService != null) {
            try {
                mService.performNotificationEvent(action, pkg, key);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void registerStatusChangedCallback(ISystemGuardChangedCallback callback) {
        if (mService != null) {
            try {
                mService.registerStatusChangedCallback(callback);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void unregisterStatusChangedCallback(ISystemGuardChangedCallback callback) {
        if (mService != null) {
            try {
                mService.unregisterStatusChangedCallback(callback);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void registerWindowChangedCallback(IStatusBarWindowChangedCallback callback) {
        if (mService != null) {
            try {
                mService.registerWindowChangedCallback(callback);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void unregisterWindowChangedCallback(IStatusBarWindowChangedCallback callback) {
        if (mService != null) {
            try {
                mService.unregisterWindowChangedCallback(callback);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }
}
